package com.company.user;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller("controller")
public class User {

    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
   @Bean
    public User user(){
        User user=new User();
        user.setName("张三");
        user.setAge(18);
        return user;
    }
    @Bean
    public User user2(){
        User user2=new User();
        user2.setName("李四");
        user2.setAge(20);
        return user2;
    }
}
